<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>面试题(反馈)</title>
    <style>
        *,body{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 300px;
            height: 100px;
            background-color: red;
            text-align: center;
        }
        .box::after{
            content: '这是一个标签';
            line-height: 100px;
        }
        .triangle{
            border-top: 50px solid transparent;
            border-left:100px solid blue;
            border-right: 50px solid transparent;
            border-bottom: 50px solid transparent;
            position: absolute;
            left: 300px;
            top:0px;
        }
        .circle{
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: aqua;
            position: absolute;
            left: 325px;/*box的宽度+三角形宽度一半*/
            top: 40px;/*三角形高度一半-自身一半*/
        }
        .box b{
            line-height: 100px;/*行高与box一致,垂直居中...*/
            color: white;
        }
    </style>
</head>
<body>
    <div class="box">
        <!-- <b>这是一个标签</b> -->
        <div class="triangle"></div>
        <div class="circle"></div>
    </div>
    <h1>2022-7-12</h1>
    <p id="text">第四届GMIS由阿拉伯联合酋长国共业与先进技术部与联合国工业发展组织共同举办，主题“重塑社会，设立数字化新目标，促进繁荣”</p>
    <script>
        let text=document.getElementById("text").innerText;
        /**关键词:
         *  阿联酋，阿拉伯，阿拉伯联合酋长国
         */
        function lightWord(article, oldWord){
            for(let i=0;i<oldWord.length;i++){
                    let regExp = new RegExp(oldWord[i], 'g');//正则表达式方法，完全匹配对应的关键字，且声明全局
                    article = article.replace(regExp, `<span style="color:#f00">${oldWord[i]}</span>`);
            }
            return article;
        }
        document.getElementById("text").innerHTML=lightWord(text,['阿拉伯','阿拉伯联合酋长国','阿联酋']);
    </script>
</body>
</html>